import request from '../axios/request.js'

// 获取所有作者
export const authorsRequest = () => {
    return request.get('/book/authors')
}

// 分页条件查询
export const booksPageRequest = data => {
    return request.post('/book/all', data)
}

// 新增书籍
export const addBookRequest = data => {
    return request.post('/book', data)
}

// 更新书籍
export const updateBookRequest = data => {
    return request.put('/book', data)
}

// 删除书籍
export const deleteBookRequest = id => {
    return request.delete(`/book/${id}`)
}

// 批量删除书籍
export const deleteBooksRequest = ids => {
    return request.delete('/book', { data: ids })
}